use crate::pb::hello_service_client::HelloServiceClient;
use crate::pb::{HelloRequest, HelloResponse};
use tonic::transport::Server;

mod pb;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut client = HelloServiceClient::connect("http://127.0.0.1:3000").await?;

    let request = tonic::Request::new(HelloRequest {
        name: "Tonic".into(),
    });

    let response = client.hello(request).await?;

    println!("RESPONSE={:?}", response.into_inner().result);

    Ok(())
}
